package com.sp2.dev.test.simplefactory;

/**
 * Created by IntelliJ IDEA.
 * User: zhimingli
 * Date: 14-1-23
 * Time: 下午4:51
 * To change this template use File | Settings | File Templates.
 */
public class FruitFactory {
    public static Fruit factory(String what){
        if("apple".equalsIgnoreCase(what)){
            return new Apple("apple");
        }else if("rice".equalsIgnoreCase(what)){
            return new Rice("rice");
        }
        return null;
    }
}
